package org.vergil.core.designpattern.command;

/**
 * Created by vergil on 17-3-23.
 */
public class App {
    public static void main(String[] args){

        FunctionButton fb1,fb2;
        fb1 = new FunctionButton("功能键1");
        fb2 = new FunctionButton("功能键1");

        AbstractCommand command1,command2;
        command1 = new HelpCommand();
        command2 = new MinimizeCommand();

        //将命令对象注入功能键
        fb1.setCommand(command1);
        fb2.setCommand(command2);

        fb1.onClick();
        fb2.onClick();

    }
}
